package main

import "fmt"

// 返回一个“返回int的函数”
func fibonacci() func() int {
	x0:=0
	x1:=1
	return func() int{
		x1 = x0 + x1
		x0 = x1 - x0
		return x1
	}
}

func main() {
	f := fibonacci()
	for i := 0; i < 10; i++ {
		fmt.Println(f())
	}
}